home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / m2gem106.lzh / CRYSTAL1.06 / SRC / CRYSTAL / VPRINTER.MOD < prev    next >
Encoding:
Modula Implementation  |  1993-03-28  |  4.5 KB  |  190 lines

  1. IMPLEMENTATION MODULE VPrinter;
  2.  
  3. (*
  4. VDI Printer Functions.
  5.  
  6. UK __DATE__ __TIME__
  7. *)
  8.  
  9. (*IMP_SWITCHES*)
  10.  
  11. FROM VDI      IMPORT contrl,intin,ptsin,intout,ptsout,v,vdi,CallVDI,
  12.                      CallVDIEsc,CallEsc,EOS,XY,MaxInput,Integer;
  13. FROM PORTAB   IMPORT UNSIGNEDWORD,SIGNEDWORD;
  14. FROM SYSTEM   IMPORT ADR;
  15. CAST_IMPORT
  16.  
  17. PROCEDURE VFormAdv(Handle: UNSIGNEDWORD);
  18. BEGIN
  19.   CallEsc(20,Handle);
  20. END VFormAdv;
  21.  
  22. PROCEDURE VOutputWindow(    Handle: UNSIGNEDWORD;
  23.                         VAR PXY   : ARRAY OF XY);
  24. #if long
  25. VAR i: [0..3];
  26. #endif
  27. BEGIN
  28. #if long
  29.   FOR i:= 0 TO 3 DO
  30.     ptsin[i]:= PXY[i];
  31.   END;
  32. #else
  33.   v.pioff:= ADR(PXY);
  34. #endif
  35.   CallVDIEsc(21,2,0,Handle);
  36. #if not long
  37.   v.pioff:= ADR(ptsin);
  38. #endif
  39. END VOutputWindow;
  40.  
  41. PROCEDURE VClearDispList(Handle: UNSIGNEDWORD);
  42. BEGIN
  43.   CallEsc(22,Handle);
  44. END VClearDispList;
  45.  
  46. PROCEDURE VBitImage(    Handle: UNSIGNEDWORD;
  47.                     VAR Path  : ARRAY OF CHAR;
  48.                         Aspect: BOOLEAN;
  49.                         XScale: BOOLEAN;
  50.                         YScale: BOOLEAN;
  51.                         HAlign: HorizontalAlignments;
  52.                         VAlign: VerticalAlignments;
  53.                     VAR PXY   : ARRAY OF XY);
  54.  
  55. VAR i: [0..MaxInput];
  56.  
  57. BEGIN
  58. #if long
  59.   FOR i:= 0 TO 3 DO
  60.     ptsin[i]:= PXY[i];
  61.   END;
  62. #else
  63.   v.pioff:= ADR(PXY);
  64. #endif
  65.   intin[0]:= ORD(Aspect);
  66.   intin[1]:= ORD(XScale);
  67.   intin[2]:= ORD(YScale);
  68.   intin[3]:= ORD(HAlign);
  69.   intin[4]:= ORD(VAlign);
  70.   i:= 0;
  71.   WHILE Path[i] # EOS DO
  72.     intin[i + 5]:= ORD(Path[i]);
  73.     INC(i);
  74.   END;
  75.   CallVDIEsc(23,2,i + 4,Handle); (* (i - 1) + 5 = i + 4 *)
  76. #if not long
  77.   v.pioff:= ADR(ptsin);
  78. #endif
  79. END VBitImage;
  80.  
  81. PROCEDURE VXBitImage(    Handle    : UNSIGNEDWORD;
  82.                      VAR Path      : ARRAY OF CHAR;
  83.                          Aspect    : BOOLEAN;
  84.                          XScale    : BOOLEAN;
  85.                          YScale    : BOOLEAN;
  86.                          HAlign    : HorizontalAlignments;
  87.                          VAlign    : VerticalAlignments;
  88.                          Rotate    : UNSIGNEDWORD;
  89.                          BackGround: UNSIGNEDWORD;
  90.                          ForeGround: UNSIGNEDWORD;
  91.                      VAR PXY       : ARRAY OF XY);
  92.  
  93. VAR i: [0..MaxInput];
  94.  
  95. BEGIN
  96. #if long
  97.   FOR i:= 0 TO 3 DO
  98.     ptsin[i]:= PXY[i];
  99.   END;
  100. #else
  101.   v.pioff:= ADR(PXY);
  102. #endif
  103.   intin[0]:= ORD(Aspect);
  104.   intin[1]:= ORD(XScale);
  105.   intin[2]:= ORD(YScale);
  106.   intin[3]:= ORD(HAlign);
  107.   intin[4]:= ORD(VAlign);
  108.   intin[5]:= Rotate;
  109.   intin[6]:= BackGround;
  110.   intin[7]:= ForeGround;
  111.   i:= 0;
  112.   WHILE Path[i] # EOS DO
  113.     intin[i + 8]:= ORD(Path[i]);
  114.     INC(i);
  115.   END;
  116.   CallVDIEsc(23,2,i + 7,Handle); (* (i - 1) + 8 = i + 7 *)
  117. #if not long
  118.   v.pioff:= ADR(ptsin);
  119. #endif
  120. END VXBitImage;
  121.  
  122. PROCEDURE VQScan(    Handle     : UNSIGNEDWORD;
  123.                  VAR Slices     : UNSIGNEDWORD;
  124.                  VAR PageHeight : UNSIGNEDWORD;
  125.                  VAR SliceHeight: UNSIGNEDWORD;
  126.                  VAR LinesPage  : UNSIGNEDWORD;
  127.                  VAR DivFactor  : UNSIGNEDWORD);
  128. BEGIN
  129.   CallEsc(24,Handle);
  130.   Slices:= intout[0];
  131.   PageHeight:= intout[1];
  132.   SliceHeight:= intout[2];
  133.   LinesPage:= intout[3];
  134.   DivFactor:= intout[4];
  135. END VQScan;
  136.  
  137. PROCEDURE VAlphaText(    Handle: UNSIGNEDWORD;
  138.                      VAR String: ARRAY OF CHAR);
  139.  
  140. VAR i: [0..MaxInput];
  141.  
  142. BEGIN
  143.   i:= 0;
  144.   WHILE String[i] # EOS DO
  145.     intin[i]:= ORD(String[i]);
  146.     INC(i);
  147.   END;
  148.   CallVDIEsc(25,0,i,Handle); (* i - 1 + 1 = i *)
  149. END VAlphaText;
  150.  
  151. PROCEDURE VOrient(Handle: UNSIGNEDWORD;
  152.                   Orient: Orientations);
  153. BEGIN
  154.   intin[0]:= ORD(Orient);
  155.   CallVDIEsc(27,0,1,Handle);
  156. END VOrient;
  157.  
  158. PROCEDURE VCopies(Handle: UNSIGNEDWORD;
  159.                   Count : UNSIGNEDWORD);
  160. BEGIN
  161.   intin[0]:= Count;
  162.   CallVDIEsc(28,0,1,Handle);
  163. END VCopies;
  164.  
  165. PROCEDURE VTray(Handle: UNSIGNEDWORD;
  166.                 Tray  : SIGNEDWORD);
  167. BEGIN
  168.   intin[0]:= Tray;
  169.   CallVDIEsc(29,0,1,Handle);
  170. END VTray;
  171.  
  172. PROCEDURE VPSHalftone(Handle   : UNSIGNEDWORD;
  173.                       Index    : UNSIGNEDWORD;
  174.                       Angle    : UNSIGNEDWORD;
  175.                       Frequency: UNSIGNEDWORD);
  176. BEGIN
  177.   intin[0]:= Index;
  178.   intin[1]:= Angle;
  179.   CallVDIEsc(32,0,1,Handle);
  180. END VPSHalftone;
  181.  
  182. PROCEDURE VEscape2000(Handle: UNSIGNEDWORD;
  183.                       Times : UNSIGNEDWORD);
  184. BEGIN
  185.   intin[0]:= Times;
  186.   CallVDIEsc(2000,0,1,Handle);
  187. END VEscape2000;
  188.  
  189. END VPrinter.
  190.